<html>
<head><meta charset="utf-8"><title>Standalone SSR · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html">Standalone SSR</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211019357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211019357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Barsky <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211019357">(Sep 23 2020 at 15:26)</a>:</h4>
<p>I wanted check on the feasibility of using rust-analyzer's SSR functionality as a standalone <code>cargo fix</code>-style refactoring tool for breaking changes in crates. is that feasible/a good idea at this time?</p>



<a name="211019475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211019475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211019475">(Sep 23 2020 at 15:27)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="254853">@pksunkara</span> was also interested in that, for porting code to <code>clap</code> 3.</p>



<a name="211019598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211019598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Barsky <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211019598">(Sep 23 2020 at 15:28)</a>:</h4>
<p>gotcha. I know that portions of rust-analyzer are published to <a href="http://crates.io">crates.io</a>, but i'm not sure if _this_ portion is.</p>



<a name="211023269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211023269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211023269">(Sep 23 2020 at 15:54)</a>:</h4>
<p>Thanks for the mention <span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> </p>
<p><span class="user-mention" data-user-id="198819">@David Barsky</span> I have a minimum viable code at <a href="https://github.com/pksunkara/cargo-up">https://github.com/pksunkara/cargo-up</a>. And the related code that describes the breaking changes is at <a href="https://github.com/clap-rs/clap/blob/master/clap_up/src/lib.rs">https://github.com/clap-rs/clap/blob/master/clap_up/src/lib.rs</a>. We can have a call if you are interested in working on this.</p>



<a name="211023471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211023471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211023471">(Sep 23 2020 at 15:55)</a>:</h4>
<p>In fact, I was the one who did the work to publish rust-analyzer on <a href="http://crates.io">crates.io</a> so that I can use those deps in this tool.</p>



<a name="211024036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211024036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Barsky <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211024036">(Sep 23 2020 at 15:59)</a>:</h4>
<p>Thanks for offer for the call, but I think I'm good for now. what sort of work is remaining on this thing?</p>



<a name="211027056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211027056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> David Barsky <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211027056">(Sep 23 2020 at 16:21)</a>:</h4>
<p>ah, my response was to an incorrect read of a now-edited comment. nevermind!</p>



<a name="211041897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211041897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211041897">(Sep 23 2020 at 18:15)</a>:</h4>
<p>As I said, there's almost nothing else needed from rust-analyzer side. The only main thing left to do in the tool is <a href="https://github.com/pksunkara/cargo-up/blob/541e7b0e83dbb733e29ae4980c1b6fd7a7b6bc21/cargo-up/src/cli/dep.rs#L88">https://github.com/pksunkara/cargo-up/blob/541e7b0e83dbb733e29ae4980c1b6fd7a7b6bc21/cargo-up/src/cli/dep.rs#L88</a>.</p>



<a name="211042068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211042068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211042068">(Sep 23 2020 at 18:16)</a>:</h4>
<p>Everything else can be added later. I am slowly trying to get it working for <code>clap</code> 3.0 release, so that all people have to do is <code>cargo up dep clap</code>. And then we can try to add more features once people start to use it for their deps too</p>



<a name="211102405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Standalone%20SSR/near/211102405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Standalone.20SSR.html#211102405">(Sep 24 2020 at 08:32)</a>:</h4>
<p>I think we already expose this as a CLI?</p>
<div class="codehilite"><pre><span></span><code>λ rust-analyzer --help ^| tail -n 8
ssr [RULE...]
    &lt;RULE&gt;            A structured search replace rule (`$a.foo($b) ==&gt; bar($a, $b)`)

search [PATTERN..]
    &lt;PATTERN&gt;         A structured search replace pattern (`$a.foo($b)`)
    --debug &lt;snippet&gt; Prints debug information for any nodes with source exactly
                      equal to &lt;snippet&gt;
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>